#ifndef _SIGNAL_H
#define _SIGNAL_H

#include <nxos.h>

#ifdef __cplusplus
extern "C" {
#endif

/* Signals. */
#define	SIGINT		NX_SIGNAL_INTERRUPT /* Interrupt (ANSI).  */
#define	SIGILL		NX_SIGNAL_ILLEGAL	/* Illegal instruction (ANSI).  */
#define	SIGABRT		NX_SIGNAL_ABORT	    /* Abort (ANSI).  */
#define	SIGFPE		NX_SIGNAL_FPE	    /* Floating-point exception (ANSI).  */
#define	SIGSEGV		NX_SIGNAL_SEGV	    /* Segmentation violation (ANSI).  */
#define	SIGTERM		NX_SIGNAL_TERMINATE	/* Termination (ANSI).  */

#define	_NSIG		32

#define SIG_ERR  ((void (*)(int))-1)
#define SIG_DFL  ((void (*)(int)) 0)
#define SIG_IGN  ((void (*)(int)) 1)

typedef int sig_atomic_t;

typedef void (*sighandler_t)(int);
sighandler_t signal(int signum, sighandler_t handler);
int raise(int signum);

#ifdef __cplusplus
}
#endif

#endif /* _SIGNAL_H */
